<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>植物大战僵尸图鉴</title>
    <style>
        /* 新增导航栏样式 */
        .header {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            margin-bottom: 20px;
        }

        .auth-btn {
            padding: 10px 25px;
            margin-left: 15px;
            border-radius: 25px;
            text-decoration: none;
            transition: all 0.3s ease;
        }

        .login-btn {
            background-color: #3498db;
            color: white;
        }

        .register-btn {
            background-color: #27ae60;
            color: white;
        }

        .auth-btn:hover {
            opacity: 0.8;
            transform: translateY(-2px);
        }

        /* 原有样式保持不变 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: '微软雅黑', sans-serif;
        }

        body {
            background: #f0f4f5;
            padding: 20px;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
        }

        .plant-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 20px;
        }

        .plant-card {
            background: white;
            border-radius: 15px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            overflow: hidden;
        }

        .plant-image {
            width: 100%;
            height: auto;
            /* 高度自适应 */
            aspect-ratio: 1 / 1;
            /* 强制保持宽高比（如果需要固定比例，例如 1:1） */
            object-fit: contain;
            /* 图片保持比例缩放 */
            background: #e0e0e0;
        }

        .plant-info {
            padding: 20px;
        }

        .plant-name {
            font-size: 24px;
            color: #2c3e50;
            margin-bottom: 10px;
        }

        .plant-stats {
            display: flex;
            justify-content: space-between;
            margin-bottom: 15px;
            padding: 10px;
            background: #ecf0f1;
            border-radius: 8px;
        }

        .stat-item {
            text-align: center;
            flex: 1;
        }

        .stat-title {
            color: #7f8c8d;
            font-size: 14px;
            margin-bottom: 5px;
        }

        .stat-value {
            font-weight: bold;
            color: #2c3e50;
        }

        .plant-description {
            color: #666;
            line-height: 1.6;
        }

        @media (max-width: 768px) {
            .plant-grid {
                grid-template-columns: 1fr;
            }

            .plant-image {
                height: auto;
                /* 保持自适应 */
                aspect-ratio: unset;
                /* 移除固定比例（如果需要） */
            }
        }
    </style>
</head>

<body>
    <div class="container">
        <!-- 新增导航栏 -->
        <div class="header">
            <a href="login.html" class="auth-btn login-btn">登录</a>
            <a href="register.html" class="auth-btn register-btn">注册</a>
        </div>

        <h1 style="text-align: center; color: #2c3e50; margin-bottom: 30px;">植物大战僵尸图鉴</h1>
        <div class="plant-grid">
            <!-- 植物卡片 -->
            <div class="plant-card">
                <img src="peashooter.png" alt="豌豆射手" class="plant-image">
                <div class="plant-info">
                    <h2 class="plant-name">豌豆射手</h2>
                    <div class="plant-stats">
                        <div class="stat-item">
                            <div class="stat-title">阳光消耗</div>
                            <div class="stat-value">100</div>
                        </div>
                        <div class="stat-item">
                            <div class="stat-title">伤害</div>
                            <div class="stat-value">20（普通）</div>
                        </div>
                        <div class="stat-item">
                            <div class="stat-title">射程</div>
                            <div class="stat-value">前方整行</div>
                        </div>
                    </div>
                    <div class="plant-description">
                        基础攻击植物，每次攻击发射一颗豌豆，适合作为初期防线。
                    </div>
                </div>
            </div>

</html>
<!-- 其他植物卡片保持不变... -->
<!-- 向日葵 -->
<div class="plant-card">
    <img src="sunflower.png" alt="向日葵" class="plant-image">
    <div class="plant-info">
        <h2 class="plant-name">向日葵</h2>
        <div class="plant-stats">
            <div class="stat-item">
                <div class="stat-title">阳光消耗</div>
                <div class="stat-value">50</div>
            </div>
            <div class="stat-item">
                <div class="stat-title">生产间隔</div>
                <div class="stat-value">24秒</div>
            </div>
            <div class="stat-item">
                <div class="stat-title">特性</div>
                <div class="stat-value">生产阳光</div>
            </div>
        </div>
        <div class="plant-description">
            基础生产植物，每24秒生产25阳光，是建立防线的重要经济来源。
        </div>
    </div>
</div>

<!-- 樱桃炸弹 -->
<div class="plant-card">
    <img src="cherry_bomb.png" alt="樱桃炸弹" class="plant-image">
    <div class="plant-info">
        <h2 class="plant-name">樱桃炸弹</h2>
        <div class="plant-stats">
            <div class="stat-item">
                <div class="stat-title">阳光消耗</div>
                <div class="stat-value">150</div>
            </div>
            <div class="stat-item">
                <div class="stat-title">伤害范围</div>
                <div class="stat-value">3x3</div>
            </div>
            <div class="stat-item">
                <div class="stat-title">特性</div>
                <div class="stat-value">即时爆炸</div>
            </div>
        </div>
        <div class="plant-description">
            高伤害范围攻击植物，爆炸后消失，适合应对紧急状况。
        </div>
    </div>
</div>

<!-- 坚果墙 -->
<div class="plant-card">
    <img src="wall_nut.png" alt="坚果墙" class="plant-image">
    <div class="plant-info">
        <h2 class="plant-name">坚果墙</h2>
        <div class="plant-stats">
            <div class="stat-item">
                <div class="stat-title">阳光消耗</div>
                <div class="stat-value">50</div>
            </div>
            <div class="stat-item">
                <div class="stat-title">耐久</div>
                <div class="stat-value">4000</div>
            </div>
            <div class="stat-item">
                <div class="stat-title">特性</div>
                <div class="stat-value">阻挡僵尸</div>
            </div>
        </div>
        <div class="plant-description">
            基础防御植物，能承受大量伤害，为后排植物争取攻击时间。
        </div>
    </div>
</div>

<!-- 寒冰射手 -->
<div class="plant-card">
    <img src="snow_pea.png" alt="寒冰射手" class="plant-image">
    <div class="plant-info">
        <h2 class="plant-name">寒冰射手</h2>
        <div class="plant-stats">
            <div class="stat-item">
                <div class="stat-title">阳光消耗</div>
                <div class="stat-value">175</div>
            </div>
            <div class="stat-item">
                <div class="stat-title">伤害</div>
                <div class="stat-value">20（普通）</div>
            </div>
            <div class="stat-item">
                <div class="stat-title">特性</div>
                <div class="stat-value">减速僵尸</div>
            </div>
        </div>
        <div class="plant-description">
            升级版豌豆射手，每次攻击附带减速效果，有效延缓僵尸进攻。
        </div>
    </div>
</div>
<!-- 添加更多植物卡片... -->
<!-- 复制上述卡片结构，修改图片路径和文字内容 -->
</div>
</div>
</body>

</html>